<%@page isELIgnored="false" pageEncoding="UTF-8" contentType="text/html; UTF-8" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>分类列表</title>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css" />
	<script type="text/javascript" src="${pageContext.request.contextPath}/layui/layui.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.12.4.js"></script>
</head>
<body>
<!--分类树形列表-->
	<div id="category"></div>
<!--渲染树形列表-->
	<script type="text/javascript">
		layui.use("tree",function(){
			var tree = layui.tree;
			var $ = layui.jquery;
			$.ajax({
				"url":"${pageContext.request.contextPath}/category/nodes",
				"type":"get",
				"dataType":"json",
				"success":function(result){
					tree.render({
						elem:"#category",
						data:result
					});
				}
			})
		})
	</script>
</body>
</html>